var viewActionModel = new function () {
    this.TypeId = ko.observable(0);
    this.Title = ko.observable("").extend({ required: { message: "Tiêu đề là yêu cầu"} });
    this.NoteRequired = ko.observable(false);
    this.ProgramId = ko.observable(0);
    this.IsContactAttempt = ko.observable(false);
    this.MilestoneOptions = ko.observableArray(data.MilestoneList);
    this.MilestoneId = ko.observable(this.MilestoneOptions()[0].ID);
    this.OcdMilestoneId = ko.observable(this.MilestoneOptions()[0].ID);
    this.CalendarItemRequired = ko.observable(false);

    this.Submit = function () {
        if (viewActionModel.errors().length == 0) {
            $('form').submit();
        }
        this.errors.showAllMessages();
    }
}

viewActionModel.errors = ko.validation.group(viewActionModel);
ko.validation.rules.pattern.message = 'Invalid.';
ko.applyBindings(viewActionModel, document.getElementById("main"));